package com.woniuxy.creditsystem.RecordMag.service.impl;

import com.woniuxy.creditsystem.RecordMag.service.IRecordService;
import com.woniuxy.creditsystem.common.bean.CreditRecordInfo;
import com.woniuxy.creditsystem.common.mapper.RecordMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：zhengbin
 * @date ：Created in 2020/12/12
 * @description：业务层
 * @modified By：
 * @version: 1.0v
 */
@Transactional(readOnly = true)
@Service
public class RecordServiceImpl  implements IRecordService {

    @Resource
    private RecordMapper recordMapper;

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public int savaRecord(CreditRecordInfo creditRecordInfo) {
        return recordMapper.savaRecord(creditRecordInfo);
    }

    @Override
    public List<CreditRecordInfo> findAll() {
        return recordMapper.findAll();
    }

    @Override
    public CreditRecordInfo findByid(long fkAppyId) {


        return recordMapper.findByid(fkAppyId);
    }
}
